package me.zhengjie.modules.weixin.message.reply;


import me.zhengjie.modules.weixin.enums.WeChatMsgTypeEnum;
import org.apache.commons.lang3.StringUtils;

/**
 * 被动回复图片消息
 *
 */
public class ReplyImageMessage extends AbstractReplyMessage {

    public ReplyImageMessage() {
        super();
        setMsgType(WeChatMsgTypeEnum.image.name());
    }

    public ReplyImageMessage(String mediaId) {
        this();
        ImageMessage image = new ImageMessage();
        image.MediaId = mediaId;
        this.Image = image;
    }

    private ImageMessage Image;

    public ImageMessage getImage() {
        return Image;
    }

    public void setImage(ImageMessage image) {
        Image = image;
    }

    public static class ImageMessage {

        private String MediaId;

        public String getMediaId() {
            return MediaId;
        }

        public void setMediaId(String mediaId) {
            MediaId = mediaId;
        }
    }

    @Override
    public boolean isValidReply() {

        return null != Image && StringUtils.isNotBlank(Image.MediaId);
    }
}

